package jtk.project4.fleet.field;

import jtk.project4.fleet.domain.Equipment;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.CheckControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.field.TextField;
import nl.coderight.jazz.form.field.button.CheckButton;

public class EquipmentConfigureVirtualField extends GroupControl<Equipment>{
	private CheckControl VirtualCheckField ;
	private CheckButton EnableVirtualCalculationsForMeter1Field ;
	private TextField AverageDailyIncrementField;
	private CalendarControl StartDateField;
	
	
	public EquipmentConfigureVirtualField(String bindID) {
		setTitle("header.equipmentconfigurevirtual");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields() {
		VirtualCheckField = new CheckControl("Virtual", 1,1 );
		EnableVirtualCalculationsForMeter1Field= new CheckButton("Enable Virtual Calculations For Meter 1");
		AverageDailyIncrementField = new TextField("Average Daily Increment", 10);
		StartDateField = new CalendarControl("Start Date", 20);
		StartDateField.setPreferredSize(AverageDailyIncrementField.getPreferredSize());
		VirtualCheckField.addCheckButton(EnableVirtualCalculationsForMeter1Field, "Enable Virtual Calculations For Meter 1");
		}	
	private void createLayout(){
	setLayout(new FormLayout())
			
			.addField(EnableVirtualCalculationsForMeter1Field)
			.addRow()
			.addLabel("Average Daily Increment")			.addField(AverageDailyIncrementField)
			.addRow()
			.addLabel("Start Date")			.addField(StartDateField)			
			.addRow()
			/*.addLabel("(user defined)")			.addField(custVal4Field)
			*/
			;
		
	}
	
}	
	

